import QtQuick
import QtQuick.Controls
import "../component" as C

Item {
    TempDial {
        anchors.top: parent.top
        anchors.topMargin: 80
        anchors.horizontalCenter: parent.horizontalCenter
        width: 800
        height: 1000
        value: collectionInfo.temperature
        minValue: 0
        maxValue: 100
        icon: ""
        unit: "°C"
        title: "当前温度"
        setTitle: "设定温度:"
        
        onValueModified: function(newValue) {
            console.log("新温度值:", newValue)
        }
    }
    Loader {
        id: temperatureSettingPage
        source: "qrc:/pages/RangeSettingPage.qml"
        onLoaded: {
            item.title= "温度设置"
            item.type="temperature"
        }
    }

    // 右上角：kg / cal / 参数设置 图片按钮
    Row {
        anchors.top: parent.top
        anchors.right: parent.right
        anchors.topMargin: 20
        anchors.rightMargin: 20
        spacing: 15

        C.ZButtonImage{
            btnImagePressed: "qrc:/assets/icon_settings_parameters_pressed.png"
            btnImage:"qrc:/assets/settings_parameters.png"
            onClicked: {
                var weightParam = alarmInfo.getTemperatureParam();
                temperatureSettingPage.item.setValue(weightParam["hh"],
                                                weightParam["h"],
                                                weightParam["l"],
                                                weightParam["ll"],
                                                weightParam["hhStatus"],
                                                weightParam["hStatus"],
                                                weightParam["lStatus"],
                                                weightParam["llStatus"])
                temperatureSettingPage.item.visible = true;

            }
        }
    }

}
